Digital video cameras for mainly capturing moving images and digital still cameras for mainly capturing still images are widely used. Some of these cameras can capture both moving images and still images. Furthermore, so-called camera-equipped cell phone terminals, camera-equipped portable electronic notebooks and so on provided with a digital camera function are also becoming widely used.
In these apparatuses having an imaging function, such as the digital cameras and camera-equipped cell phone terminals, if moving image data and still image data obtained through imaging are recorded as they are in a recording medium (storage medium) of which recording capacity is finite, the recording capacity of the recording medium is fully occupied soon since the data amount of these obtained image data is large.
Therefore, when image data arising from imaging is recorded in a storage medium, the image data is subjected to data compression processing based on any of various systems so that the data amount thereof is reduced, followed by being recorded in the storage medium. For example, when image data to be recorded is moving image data, a data compression system such as the MPEG (Moving Picture Experts Group) system is used. When image data to be recorded is still image data, a data compression system such as the JPEG (Joint Photographic Experts Group) system is used.
A description will be made on one example of an existing image compression device. FIG. 9 shows one example of an existing image compression processing device that subjects still image data to data compression by the JPEG system for example. In this existing image compression processing device shown in FIG. 9, compression-target image data supplied to this device is provided to a DCT (Discrete Cosine Transform) unit 101 and is subjected to the discrete cosine transform therein to thereby be transformed from components along the time axis into components along the frequency axis. The image data transformed into the frequency-axis components is supplied to a quantizer 102.
The quantizer 102 adjusts the compression rate of the image data from the DCT unit 101 based on quantization table information obtained from a fixed-length quantization table creator 107, and supplies the adjusted image data to a variable-length coder 103. The variable-length coder 103 executes variable-length coding for the image data from the quantizer 102 by use of variable-length codes such as the Huffman codes. The variable-length coder 103 outputs the coded data as compressed image data and supplies it to a byte calculator 104.
The byte calculator 104 calculates the number of bytes of the compressed image data corresponding to one screen based on the coded image data from the variable-length coder 103, and supplies the calculation result to a quantization scale calculator 105. The quantization scale calculator 105 calculates the difference between the number of bytes calculated by the byte calculator 105 and a predetermined number of bytes to thereby calculate a compression rate adjustment amount, i.e., quantization scales. The calculation result by the quantization scale calculator 105 is supplied to the fixed-length quantization table creator 106.
The fixed-length quantization table creator 106 creates a new quantization table based on the newly calculated quantization scales as the calculation result from the quantization scale calculator 105 and a quantization table 107 supplied from a quantization table unit 107, and supplies the new quantization table to the quantizer 102. The above-described loop processing is repeated multiple times so that the image data is stepwise compressed into data having a predetermined data size.
However, because compression processing is executed multiple times (retry of compression processing is repeated) until an adequate compression rate is obtained as described above, it takes a long period to complete the compression processing. Therefore, an imaging device employing an image compression processing device like that described with FIG. 9 involves a problem that a short imaging interval cannot be used because of the long period for completion of compression processing for captured image data to be recorded. Furthermore, repeating compression processing multiple times needs provision of a high-capacity memory for holding the entire data of an original image.
In contrast, if compression into a predetermined data size through only one time of compression processing is intended, a high compression rate needs to be used. However, although a data size can be easily decreased to smaller than a predetermined size, an unnecessarily high compression rate possibly causes so-called block noise and mosquito noise, which leads to deterioration of the quality of a reproduced image.
As a solution to these problems, a technique to allow rapid and appropriate data compression through one time of data compression processing is disclosed in Japanese Patent Laid-open No. 2003-199019. In this technique, high-frequency components of an image to be recorded are extracted based on a thumbnail image of the image to be recorded, and the image data amount corresponding to one screen is predicted based on the extracted components, so that an adequate compression rate is set based on the prediction result.